<%@page import="doan.quanlycanbo.portlet.util.PortletKeysExt"%>
<%@page import="com.liferay.portal.kernel.language.LanguageUtil"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ include file="/init.jsp" %>

<%
ResultRow row = (ResultRow) request.getAttribute( WebKeys.SEARCH_CONTAINER_RESULT_ROW);
Object typeGeneralO = row.getParameter("typeGeneral");
int typeGeneral = 0;
if(typeGeneralO != null){
	typeGeneral = Integer.valueOf(typeGeneralO.toString()) ;
}
long groupId = themeDisplay.getScopeGroupId();
String primKey = "";

// Khoi don vi quan ly
khoidonviquanly kdv = new khoidonviquanlyImpl();
if(typeGeneral == PortletKeysExt.ADD_KHOIDV){
	kdv  = (khoidonviquanly) row.getObject();
	String name = khoidonviquanly.class.getName();
	primKey = String.valueOf(kdv.getPrimaryKey());
}

// Hoc ham
hocham hocHam = new hochamImpl();
if(typeGeneral == PortletKeysExt.ADD_HOCHAM){
	hocHam  = (hocham) row.getObject();
	String name = hocham.class.getName();
	primKey = String.valueOf(hocHam.getPrimaryKey());
}

// Hoc vi
hocvi hocVi = new hocviImpl();
if(typeGeneral == PortletKeysExt.ADD_HOCVI){
	hocVi  = (hocvi) row.getObject();
	String name = hocvi.class.getName();
	primKey = String.valueOf(hocVi.getPrimaryKey());
}

// Cap uy
capuy capUy = new capuyImpl();
if(typeGeneral == PortletKeysExt.ADD_CAPUY){
	capUy = (capuy)row.getObject();
	String name = capuy.class.getName();
	primKey = String.valueOf(capUy.getPrimaryKey());
}

// Danh hieu
danhhieu danhHieu = new danhhieuImpl();
if(typeGeneral == PortletKeysExt.ADD_DANHHIEU){
	danhHieu = (danhhieu)row.getObject();
	String name = danhhieu.class.getName();
	primKey = String.valueOf(danhHieu.getPrimaryKey());
}

// Dan toc
dantoc danToc = new dantocImpl();
if(typeGeneral == PortletKeysExt.ADD_DANTOC){
	danToc = (dantoc)row.getObject();
	String name = dantoc.class.getName();
	primKey = String.valueOf(danToc.getPrimaryKey());
}

// Ton giao
tongiao tonGiao = new tongiaoImpl();
if(typeGeneral == PortletKeysExt.ADD_TONGIAO){
	tonGiao = (tongiao)row.getObject();
	String name = tongiao.class.getName();
	primKey = String.valueOf(tonGiao.getPrimaryKey());
}

// Xuat than
xuatthan xt  = new xuatthanImpl();
if(typeGeneral == PortletKeysExt.ADD_XUATTHAN){
	xt = (xuatthan)row.getObject();
	String name = xuatthan.class.getName();
	primKey = String.valueOf(xt.getPrimaryKey());
}

// Giao duc pho thong
giaoducphothong gdpt  = new giaoducphothongImpl();
if(typeGeneral == PortletKeysExt.ADD_GDPT){
	gdpt = (giaoducphothong)row.getObject();
	String name = giaoducphothong.class.getName();
	primKey = String.valueOf(gdpt.getPrimaryKey());
}

// Ngach luong
ngachluong ngachLuong  = new ngachluongImpl();
if(typeGeneral == PortletKeysExt.ADD_NGACHLUONG){
	ngachLuong = (ngachluong)row.getObject();
	String name = ngachluong.class.getName();
	primKey = String.valueOf(ngachLuong.getPrimaryKey());
}

// He so luong
hesoluong hsl  = new hesoluongImpl();
if(typeGeneral == PortletKeysExt.ADD_HESOLUONG){
	hsl = (hesoluong)row.getObject();
	String name = hesoluong.class.getName();
	primKey = String.valueOf(hsl.getPrimaryKey());
}

%>

<liferay-ui:icon-menu message='<%=LanguageUtil.get(pageContext, "managecontacts.agency.view-actions","Tac vu") %>'>

	<portlet:renderURL windowState="normal" var="updateGeneralURL">
		<portlet:param name="idGeneral" value="<%= primKey %>"></portlet:param>
		<portlet:param name="typeGeneral" value="<%= String.valueOf(typeGeneral)%>"/>
		<portlet:param name="jspPage" value="/html/manage_employee/general_manage/add_general.jsp"/>
	</portlet:renderURL>

    <liferay-ui:icon image="edit" message='<%=LanguageUtil.get(pageContext, "managecontacts.agency.view-actions.edit","Sua") %>' url="<%= updateGeneralURL.toString() %>" />

    <portlet:actionURL name="deleteGeneral" var="deleteGeneralURL">
    	<portlet:param name="typeGeneral" value="<%= String.valueOf(typeGeneral)%>"/>
      	<portlet:param name="idGeneral" value="<%= primKey %>" />
    </portlet:actionURL>

    <liferay-ui:icon image="delete" message='<%=LanguageUtil.get(pageContext, "managecontacts.agency.view-actions.delete","Xoa") %>'  url="<%= deleteGeneralURL.toString() %>" />


    <liferay-security:permissionsURL
        modelResource="<%= khoidonviquanly.class.getName() %>"
        modelResourceDescription="<%= kdv.getTenkhoi() %>"
        resourcePrimKey="<%= primKey %>"
        var="permissionsURL" />

    <liferay-ui:icon image="permissions" message='<%=LanguageUtil.get(pageContext, "managecontacts.agency.view-actions.permissions","Phan quyen") %>' url="<%= permissionsURL.toString() %>" />

</liferay-ui:icon-menu>





